package com.lg.cms.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

/**
 * @Description: freemarker配置类
 * @Author: wuyuhang
 * @create: 2020-10-06 08:14
 */
@Configuration
public class FreemarkerConfig {

    @Value("${template.path}")
    String path;

    @Bean
    FreeMarkerConfigurer freeMarkerConfigurer(){
        FreeMarkerConfigurer config = new FreeMarkerConfigurer();
        //设置模板路径
        config.setTemplateLoaderPaths("classpath:templates/", path);
        return config;
    }
}